import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'
import Login  from '../views/login/Login.vue'
import Hader from '../components/Hader.vue'
import Goods from '../views/Goods.vue'
import Member from '../views/Member.vue'
import Staff from '../views/Staff'
import Supplier from '../views/Supplier'
import Uhome from '../views/U-home.vue'
Vue.use(VueRouter)

  const routes = [
  {
    path: '/',
    name: 'Login',
    component: Login
  },
  {
    path: '/hader',
    name: 'Hader',
    component: Hader
  },
  {
    path:'/uhome',
    component:Hader,
    children:[
      {
        path:'/',
        component:Uhome,
        meta:{
          title:"首页"
        }
      }
    ]
  },
  {
    path:'/supplier',
    component:Hader,
    children:[
      {
        path:'/',
        component:Supplier,
        meta:{
          title:"供应商管理"
        }
      }
    ]
  },
  {
    path:'/member',
    component:Hader,
    children:[
      {
        path:'/',
        component:Member,
        meta:{
          title:"会员管理"
        }
      }
    ]
  },
  {
    path:'/staff',
    component:Hader,
    children:[
      {
        path:'/',
        component:Staff,
        meta:{
          title:"员工管理"
        }
      }
    ]
  },
  {
    path:'/goods',
    component:Hader,
    children:[
      {
        path:'/',
        component:Goods,
        meta:{
          title:"商品管理"
        }
      }
    ]
  }

  // {
  //   path: '/about',
  //   name: 'About',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
